/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.moravian.world;

import edu.moravian.math.Point2D;

/**
 *
 * @author Elliot
 */
public class WorldDescriptor 
{
    Point2D lowerLeft;
    Point2D upperRight;
    
    public WorldDescriptor(Point2D lowerLeft, Point2D upperRight)
    {
        this.lowerLeft = lowerLeft;
        this.upperRight = upperRight;
    }
    
    public double getMinX()
    {
        return lowerLeft.getX();
    }
    
    public double getMaxX()
    {
        return upperRight.getX();
    }
    
    public double getMinY()
    {
        return lowerLeft.getY();
    }
    
    public double getMaxY()
    {
        return upperRight.getY();
    }
    
    public Point2D getUpperLeft()
    {
        return new Point2D(lowerLeft.getX(), upperRight.getY());
    }
    
    public Point2D getUpperRight()
    {
        return new Point2D(upperRight);
    }
    
    public Point2D getLowerRight()
    {
        return new Point2D(upperRight.getX(), lowerLeft.getY());
    }
    
    public Point2D getLowerLeft()
    {
        return new Point2D(lowerLeft);
    }
    
    public Point2D getCenter()
    {
        double centerX = upperRight.getX() - lowerLeft.getX();
        double centerY = upperRight.getY() - lowerLeft.getY();
        
        return new Point2D(centerX, centerY);
    }
    
    public double getWidth()
    {
        return getMaxX() - getMinX();
    }
    public double getHeight()
    {
        return getMaxY() - getMinY();
    }
}
